<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Qlsolution extends CI_Controller {

	public function index(){

		//load helpers, libraries
		$this->load->library('session');
		$this->load->helper('url');
		
		if(isset($this->session->userdata['logged_in']) && ($this->session->userdata['logged_in'])){
			//load helpers, libraries
			$this->load->helper('directory');
			
			//check modules
			$modules = directory_map('./qlsolution/app/', 1);
			//remove disabled modules
			foreach($modules as $key => $val){
				if(substr($val, 0, 1) == '_'){
					unset($modules[$key]);
				}
			}

			//check widgets
			$widgets = directory_map('./qlsolution/js/widgets');

			//create data
			$data['modules'] = $modules;
			$data['widgets'] = $widgets;
			$data['userData'] = $this->session->userdata;
			
			$this->load->view('index', $data);
		}
		else{
			$this->load->view('login');
		}
	}

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */